package by.semerikov.store;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

import by.semerikov.converter.tostring.Converter;
import by.semerikov.generator.IGeneratable;

public class FileSystemStore {
	@SuppressWarnings("resource")
	public void save(String filePass,IGeneratable generator, Integer number)
	{
		File file = new File(filePass);
		try {
			FileWriter fileWr = new FileWriter(file);
			for (int i = 0 ; i < number;i++)
				fileWr.append(Converter.convertToString( generator.generate())+"\r\n");
			fileWr.flush();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		
	}

}
